package com.rollawizards.server
{
    public class RemoteConnectionListener extends ConnectionListener
    {
        private static const port:int = 7777

        public function RemoteConnectionListener(server:Server)
        {
            super(server);
            setup();
        }

        private function setup():void
        {
            var listener:ServerSocket = new ServerSocket();
            listener.addEventListener(Event.CONNECT, onConnect);
            listener.bind(port);
            listener.listen();
        }

        private function onConnect(event:ServerSocketConnectEvent):void
        {
            acceptClient( new RemoteProxy(event.socket) );
        }
    }
}